﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ComponentModel;
using Sinacor.Infra.Common.Exceptions;
using Sinacor.Infra.Service.ExceptionHandling;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Infra.Common.Exceptions.FaultContracts;

namespace Sinacor.Servico.Bovespa.Alocacao.Service.ServiceContract
{
    #region Métodos
    
    /// <summary>
    /// Contrato de serviço para Solicitacao
    /// </summary>
    [ExceptionShielding]
	[ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Servico.Bovespa.Alocacao.Service.ServiceContract", SessionMode = SessionMode.Allowed)]
	public interface ISolicitacao 
	{
		/// <summary>
		/// Obtem a ultima solicitação de alocação.
		/// </summary>
		/// <param name="request"></param>
        [OperationLog]
		[FaultContract(typeof(BusinessFault))]
		[FaultContract(typeof(ValidationFault))]
		[FaultContract(typeof(GeneralFault))]
		[FaultContract(typeof(InvalidSessionFault))]
		[FaultContract(typeof(LicensingFault))]
		[FaultContract(typeof(AccessIsDeniedFault))]
		[OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "ObterUltimaSolicitacao")]
		DataContract.Response.SolicitacaoResponse ObterUltimaSolicitacao(DataContract.Request.FiltroSolicitacaoRequest request);

		/// <summary>
		/// Solicita alocação.
		/// </summary>
		/// <param name="request"></param>
        [OperationLog]
		[TransactionRequired]
		[FaultContract(typeof(BusinessFault))]
		[FaultContract(typeof(ValidationFault))]
		[FaultContract(typeof(GeneralFault))]
		[FaultContract(typeof(InvalidSessionFault))]
		[FaultContract(typeof(LicensingFault))]
		[FaultContract(typeof(AccessIsDeniedFault))]
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "SolicitarAlocacao")]
		void SolicitarAlocacao(DataContract.Request.FiltroSolicitacaoRequest request);
    }

    #endregion
}